Carbon


FontToScript

Header: Script.h Carbon status: Supported

Translates a font family ID number into its corresponding script code, if that script system is currently enabled.

SInt16 FontToScript (
    SInt16 fontNumber
);
Parameter descriptions
fontNumber

A font family ID number.

function result

A script code. All recognized script codes and their defined constants are listed in “Script Codes”. FontToScript returns only explicit script codes (greater or equal 0).

If fontNumber is in the Roman range and the font force flag is TRUE, the script code returned is that of the system script and the script-forced result flag is set to TRUE.

If fontNumber is in the non-Roman range, the state of the font force flag is ignored.

If the script system corresponding to fontNumber is not enabled, the script code returned is that of the system script and the script-defaulted result flag is set to TRUE.

DISCUSSION

The information about the script code is subject to two control flags—the font force flag and the international resources selection flag. You can test and set these flags with the GetScriptManagerVariable and SetScriptManagerVariable selectors smFontForce and smIntlForce.

The function starts by initializing two result flags, the script-forced result flag and the script-defaulted result flag, to FALSE. These flags are Script Manager variables, accessed through the GetScriptManagerVariable function selectors smForced and smDefault.

SPECIAL CONSIDERATIONS

FontToScript may move memory; your application should not call this function at interrupt time.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)